import { createStore } from 'vuex'
const store = createStore({
  state () {
    return {
      version:"0.0.0",
      net: "success",//
      true_address: "",//
      wmts_address: "",//
      config_cb:"",
      buser:"",//浏览器默认用户
      
      user:{
        id:"admin"
      },
      link_task:{
        id:"",
        name:"",
      },
      task_status:[
        {
          name:"不可用",
          value:0
        },
        {
          name:"等待中",
          value:1
        },
        {
          name:"运行中",
          value:2
        },
        {
          name:"成功",
          value:3
        },
        {
          name:"错误",
          value:4
        },
      ],
      exe_type:[
        {
          name: "人工选点",
          value: "cidian"
        },
        {
          name:"解压tar包",
          value:"unzip"
        },
        {
          name:"强度转换",
          value:"sarqd"
        },
        {
          name: "原始裁切",
          value: "l1clip"
        },
        {
          name:"重写RPC",
          value:"rerpc"
        },
        {
          name:"降位处理",
          value:"bit"
        },
        {
          name: "粗匹配",
          value: "cmh"
        },
        {
          name: "自匹配",
          value: "zmh"
        },
        {
          name:"精匹配",
          value:"mh"
        },
        {
          name: "刺点合并",
          value: "mergepoints"
        },

        
        {
          name:"匹配拆分",
          value:"mh_split"
        },
        {
          name:"子项匹配",
          value:"mh_mh"
        },
        {
          name:"补充匹配",
          value:"bmh"
        },
        {
          name:"匹配合并",
          value:"mh_merge"
        },
        {
          name:"精平差",
          value:"ba"
        },
        {
          name: "粗平差",
          value: "cba"
        },
        {
          name: "自平差",
          value: "zba"
        },
        {
          name: "颜色平差",
          value: "colorba"
        },
        {
          name: "高阶重成像",
          value: "rem"
        },
        {
          name:"波段融合",
          value:"fs"
        },
        {
          name:"纠正",
          value:"rf"
        },
        {
          name:"纠正",
          value:"bayrf"
        },
        {
          name: "匀色",
          value: "god"
        },
        {
          name: "匀色镶嵌",
          value: "mosaic"
        },
        {
          name: "镶嵌线生成",
          value: "mosaicline"
        },
        {
          name: "检查删除镶嵌线",
          value: "check_mosaic_shp"
        },
        {
          name: "编辑镶嵌线",
          value: "edit_mosaic_line"
        },
        {
          name: "shp转栅格",
          value: "shp2raster"
        },
        
        {
          name:"金字塔",
          value:"py"
        },
        {
          name:"格式转换",
          value:"trans"
        },
        {
          name: "DSM生成瓦片",
          value: "dsm_tile"
        },
        {
          name: "DSM点云重建",
          value: "dsm_pc_rebuild"
        },
        {
          name: "DSM点云融合",
          value: "dsm_pc_merge"
        },
        {
          name: "DSM点云栅格化",
          value: "dsm_pc_raster"
        },
        {
          name: "DSM生成",
          value: "dsm_dsm"
        },
        {
          name: "连通性检查",
          value: "con"
        },
        {
          name: "影像裁切",
          value: "tclip"
        },
        {
          name: "重投影",
          value: "project"
        },

        

        
      ],
      ack_type:[
        {
          name:"已消费",
          value:true
        },
        {
          name:"未消费",
          value:false
        },
      ],
      yes_not:[
        {
          name:"是",
          value:1
        },
        {
          name:"否",
          value:0
        },
      ],
      mhy:[
        {
          name:"单景",
          value:1
        },
        {
          name:"区域(空间+分辨率)",
          value:2
        },
        {
          name:"区域(空间)",
          value:3
        },
      ],
      dsmmhy:[
        {
          name:"区域网匹配(按分辨率和空间分开)",
          value:2
        },
        {
          name:"区域网匹配(按空间分开)",
          value:3
        },
      ],
      bay:[
        {
          name:"普通平差",
          value:0
        },
        {
          name:"高阶平差",
          value:1
        },
      ],
      outband:[
        {
          name:"顺序全波段(BGRN)",
          value:0
        },
        {
          name:"配置波段(RGBN)",
          value:1
        },
        {
          name:"配置波段(RGB)",
          value:2
        },
      ],
      sys_config:{},
      pys:[
        {
          name:"rrd",
          value:"rrd"
        },
        {
          name:"ovr",
          value:"ovr"
        },
        {
          name:"内嵌金字塔",
          value:"in"
        },
      ],
      pyt: [
        {
          name: "nearest(最邻近)",
          value: "nearest",
        },
        {
          name: "average(非NODATA平均)",
          value: "average"
        },
        {
          name: "bilinear(双线性卷积核)",
          value: "bilinear"
        },
        {
          name: "cubic(三次卷积核)",
          value: "cubic"
        },
        {
          name: "cubicspline(样条卷积核)",
          value: "cubicspline"
        },
        {
          name: "rms(非NODATA均方根)",
          value: "rms"
        },
        {
          name: "gauss(高斯核)",
          value: "gauss"
        },
        {
          name: "lanczos(Lanczos窗口sinc卷积核)",
          value: "lanczos"
        },
        {
          name: "average_magphase(平均mag)",
          value: "average_magphase"
        },
      ],
      bits:[
        {
          name:"8",
          value:"8"
        },
        // {
        //   name:"16",
        //   value:"16"
        // },
      ],
      in_formats: [
        {
          name: "jp2",
          value: "jp2"
        },
        {
          name: "tif",
          value: "tif"
        },
        {
          name: "img",
          value: "img"
        },
      ],
      out_formats: [
        {
          name: "tif",
          value: "tif"
        },
        {
          name: "cog",
          value: "cog"
        },
        {
          name: "img",
          value: "img"
        },
      ],

      items:[
        {
          name: "影像生产",
          type: 2,
          childs: [
            {
              name: "纠正产品生产",
              type: 21,
              description: "全色、多光谱自动配对或手动选择",
              route: "produce_dom",
              img: "dom"
            },


            // {
            //   name: "从原始数据到立体像对",
            //   type: 22,
            //   description: "对原始数据进行立体像对生产",
            // },
            {
              name: "DSM产品生产",
              type: 23,
              description: "从原始卫星影像到DSM产品生产",
              route: "produce_dsm",
              img: "dsm"
            },
            {
              name: "自选融合",
              type: 14,
              description: "将已经正射后的全色、多光谱影像进行融合",
              route: "tool_fs",
              img: "fusion"
            },
            // {
            //   name: "DSM提取DEM",
            //   type: 24,
            //   description: "DSM提取DEM",
            // },
            // {
            //   name: "影像融合",
            //   type: 25,
            //   description: "影像融合",
            // },
            {
              name: "影像匀色",
              type: 26,
              description: "根据匀色底图进行单景影像匀色",
              route: "tool_god",
              img: "god"
            },
            {   
              name: "影像自动镶嵌",
              type: 27,
              description: "根据输入影像进行自动镶嵌(同时支持内部匀色)",
              route: "tool_mosaic",
              avaliable: 2,
              img: "mosaic"
            },
            // {
            //   name: "镶嵌线编辑",
            //   type: 99,
            //   description: "根据输入影像进行镶嵌线编辑",
            //   route: "tool_edit_mosaic_line",
            //   // disable:true,
            //   avaliable: 3,
            //   img: "tool_edit_mosaic_line"
            // },


            
          ]
        },
        {
          name: "常规工具",
          type: 1,
          childs:[
            {
              name: "原始Tar包解压",
              type:11,
              description: "对原始数据tar包进行检查并解压",
              route: "tool_unzip",
              img: "unziptar"
            },
            {
              name: "原始数据检查",
              type: 12,
              description: "检查原始数据的正确性,并对支持的数据进行全色、多光谱影像配对",
              route: "tool_check",
              img: "checkl1"
            },
            {
              name: "数据格式转换",
              type: 13,
              description: "数据格式转化,支持JP2、GeoTIFF、IMG、COG等",
              route: "tool_convert",
              img: "convert"
            },
            {
              name: "建立金字塔",
              type: 14,
              description: "创建金字塔,支持rrd、ovr、内嵌金字塔",
              route: "tool_py",
              img: "py"
            },
            {
              name: "降位调整",
              type: 15,
              description: "将影像数据从高位(32、16位)降为低位(16、10、8位)",
              route: "tool_bit",
              img: "bit"
            },
            
            {
              name: "原始影像筛选",
              type: 17,
              description: "将原始的L1数据进行重复性筛选,得到较少重叠区域。",
              route: "tool_screen",
              avaliable: 2,
              img: "screen"
            },
            // {
            //   name: "成果筛选",
            //   type: 18,
            //   description: "将成果影像按照空间范围进行筛选。",
            //   route: "tool_screen2",
            //   img: "screen2"
            // },
            {
              name: "重投影",
              type: 19,
              description: "将成果影像重投影至其他坐标系。",
              route: "tool_project",
              // avaliable: 2,
              img: "project"
            },
            {
              name: "影像裁切",
              type: 20,
              description: "将成果影像按照空间范围进行裁切。",
              route: "tool_clip",
              img: "clip"
            },
            // {
            //   name: "重采样",
            //   type: 16,
            //   description: "对影像进行重采样，通常从高分辨率采样到低分辨率",
            //   route:"tool_resample",
            // },
            // {
            //   name: "拉花处理",
            //   type: 17,
            //   description: "检测并清除拉花地区",
            //   route:"tool_bit",
            // },
          ]
        },
        // {
        //   name: "流程工具",
        //   type: 99,
        //   childs: [
        //     {
        //       name: "空白任务流",
        //       type: 9900,
        //       description: "点击即可新建任务流，将不同处理工具能力进行组合使用",
        //       route: "add_flow",
        //       avaliable: 2,
        //       img: "add_flow"
        //     },
        //   ]
        // },
      ],

      

      tileInfo:{
        dpi: 90.71428571427429,
        size: 256,
        origin: {
          x: -180,
          y: 90
        },
        spatialReference: {
          wkid: 4326
        },
        lods: [
          { level: 1, levelValue: 1, resolution: 0.703125, scale: 295497593.05875 },
          { level: 2, levelValue: 2, resolution: 0.3515625, scale: 147748796.52937502 },
          { level: 3, levelValue: 3, resolution: 0.17578125, scale: 73874398.264687508 },
          { level: 4, levelValue: 4, resolution: 0.087890625, scale: 36937199.132343754 },
          { level: 5, levelValue: 5, resolution: 0.0439453125, scale: 18468599.566171877 },
          { level: 6, levelValue: 6, resolution: 0.02197265625, scale: 9234299.7830859385 },
          { level: 7, levelValue: 7, resolution: 0.010986328125, scale: 4617149.8915429693 },
          { level: 8, levelValue: 8, resolution: 0.0054931640625, scale: 2308574.9457714846 },
          { level: 9, levelValue: 9, resolution: 0.00274658203125, scale: 1154287.4728857423 },
          { level: 10, levelValue: 10, resolution: 0.001373291015625, scale: 577143.73644287116 },
          { level: 11, levelValue: 11, resolution: 0.0006866455078125, scale: 288571.86822143558 },
          { level: 12, levelValue: 12, resolution: 0.00034332275390625, scale: 144285.93411071779 },
          { level: 13, levelValue: 13, resolution: 0.000171661376953125, scale: 72142.967055358895 },
          { level: 14, levelValue: 14, resolution: 8.58306884765625e-005, scale: 36071.483527679447 },
          { level: 15, levelValue: 15, resolution: 4.291534423828125e-005, scale: 18035.741763839724 },
          { level: 16, levelValue: 16, resolution: 2.1457672119140625e-005, scale: 9017.8708819198619 },
          { level: 17, levelValue: 17, resolution: 1.0728836059570313e-005, scale: 4508.9354409599309 },
          { level: 18, levelValue: 18, resolution: 5.3644180297851563e-006, scale: 2254.4677204799655 },
          { level: 19, levelValue: 19, resolution: 2.68220901489257815e-006, scale: 1127.23386023998275 },
          { level: 20, levelValue: 20, resolution: 1.341104507446289075e-006, scale: 563.616930119991375 },
        ]
      },




      //一些网页中需要同步使用的参数
      show_query:{
        current: 1,
        total: 0,
        taskid: "",
        ctaskid: "",
        flowid: "",
        exeid: "",
      },
      task_table_pagination: {
        current: 1,
        size: 'small',
        pageSize: 10,
        total: 0,
        showTotal: (total, range) => {
          return `共 ${total},${range[0]}/${range[1]}`
        },
      },

      
      //筛选的一些公共数据
      ys_tif_objects:[],//原始L1文件夹的筛选数据
      best_tif_objects_array: [],//筛选数据后的数据
      select_img_geoms:[],
    }
  },
  mutations: {//同步
    
  },
  actions: { //异步

  }
})
export default store;